package com.beck.bee.dao;

import java.io.Serializable;
import java.util.List;

/**
 * Created by sakawijaya on 3/29/2017.
 */
public interface BaseDao<T> {

    /**
     *
     * @return name space
     */
    String getNameSpace();

    /**
     *
     * @param t object need to insert
     * @return result of delete
     */
    long insert(T t);

    /**
     *
     * @param key array need to delete
     * @return  result of delete
     */
    int delete(int... key);

    /**
     *
     * @param t object need to delete
     * @return result of delete
     */
    int delete(T t);

    /**
     *
     * @param key primary key for delete
     * @return result of delete
     */
    int delete(Serializable key);

    /**
     *
     * @param t object need to update
     * @return result of update
     */
    int update(T t);

    /**
     *
     * @param key primary key
     * @return object
     */
    T select(Serializable key);

    /**
     *
     * @param t object
     * @return Array Object
     */
    List<T> select(T t);

    /**
     *
     * @param t object
     * @return int total
     */
    int selectCount(T t);

    /**
     *
     * @param t object
     * @return Array object
     */
    List<T> selectPage(T t);

}
